package IO;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class Demo08 {
    public static void main(String[] args) {
        try (Reader reader = new FileReader("d:/test.txt")){
            while(true){
//                先用int接收一下，判断是否为-1
                int w = reader.read();
                if (w == -1){
                    break;
                }
//                再转成char类型
                char ch = (char)w;
                System.out.println(ch);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
